/*
AMXX ExtraLib
by AMXX ExtraLib Dev Team
*/

enum BitwiseOperator
{
	Bitwise_Overwrite = 0,
	Bitwise_AND,
	Bitwise_OR,
	Bitwise_XOR
};

enum MenuNode
{
	MenuNode_Invalid = 0,
	MenuNode_Null = 0,
	MenuNode_Main,
	MenuNode_Options,
};

const MenuNode_c_CaptionLen = 48;
const MenuNode_c_InfoLen = 48; // 'info' aka 'header'
const MenuNode_c_DetailsLen = 400; // 'details' aka 'footer'

const MenuNode_fg_Disabled = (1<<1);
const MenuNode_fg_Persistent = (1<<2);
const MenuNode_fg_ShowAll = (1<<3);
const MenuNode_fg_ForceMenu = (1<<4);

native MenuNode:MenuNode_New(const caption[] = "", flags = 0, access_flags = -1);
native MenuNode_AddChild(MenuNodeLparent, MenuNode:child);
native MenuNode_SetCaption(MenuNode:handle, const caption[] = "");
native MenuNode_SetExtra(MenuNode:handle. any:value);
native any:MenuNode_GetExtra(MenuNode:handle);
native MenuNode_SetFlags(MenuNode:handle. flags, BitwiseOperator:op = Bitwise_Overwrite);
native MenuNode_GetFlags(MenuNode:handle);
native MenuNode_SetPageSize(MenuNode:handle, items_per_page = 7);
native MenuNode_SetInfo(const info[]);
native MenuNode_SetDetails(const details[]);
native MenuNode_Show(user, MenuNode:handle, page = 0, lifetime = 9000);

forward MenuNode_onCheckState(user, MenuNode:current, MenuNode:parent);
forward MenuNode_onBeforeShown(user, MenuNode:current, MenuNode:parent);
forward MenuNode_onSelected(user, MenuNode:current, MenuNode:parent);